home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / f2c / may_5_92.lha / f2c.VMay_5_1992 / libF77 / s_paus.c < prev    next >
C/C++ Source or Header  |  1992-05-07  |  744b  |  42 lines

  1. #include "stdio.h"
  2. #include "f2c.h"
  3. #define PAUSESIG 15
  4.  
  5. static waitpause()
  6. {
  7. return;
  8. }
  9.  
  10. VOID s_paus(s, n)
  11. char *s;
  12. ftnlen n;
  13. {
  14. int i;
  15.  
  16. fprintf(stderr, "PAUSE ");
  17. if(n > 0)
  18.     for(i = 0; i<n ; ++i)
  19.         putc(*s++, stderr);
  20. fprintf(stderr, " statement executed\n");
  21. if( isatty(fileno(stdin)) )
  22.     {
  23.     fprintf(stderr, "To resume execution, type go.  Any other input will terminate job.\n");
  24.     fflush(stderr);
  25.     if( getchar()!='g' || getchar()!='o' || getchar()!='\n' )
  26.         {
  27.         fprintf(stderr, "STOP\n");
  28.         f_exit();
  29.         exit(0);
  30.         }
  31.     }
  32. else
  33.     {
  34.     fprintf(stderr, "To resume execution, execute a   kill -%d %d   command\n",
  35.         PAUSESIG, getpid() );
  36.     signal(PAUSESIG, waitpause);
  37.     fflush(stderr);
  38.     pause();
  39.     }
  40. fprintf(stderr, "Execution resumes after PAUSE.\n");
  41. }
  42.